#!/usr/bin/env python
# -*- coding:utf-8 -*-

# file:do_set.py
# author:wmf
# datetime:2021/3/11 15:09
# software: PyCharm
'''
this is function description
'''
# import module your need

#打印集合时，系统不会打印重复元素
basket = {'apple','orange','apple','pear','orange','banana'}
print(basket)

a = set('abracadabra')
b = set('alacazam')
print(a)
print(a-b)
print(a|b)
print(a&b)
print(a^b)

print('-'*20)

a = {x for x in 'abracadabra' if x not in 'abc'}
print(a)

thisset = set(("Google","Runoob","Taobao"))
thisset.update({1,3})
print(thisset)
thisset.update([4,5],[6,7])
print(thisset)
thisset.remove("Taobao")
print(thisset)
#删除不存在的元素不会报错
thisset.discard("Facebook")
print(thisset)
x = thisset.pop();
print(x)

print("Google" in thisset)
